<?php 
include_once(''.P.'/public/header.html');
?>

<script>
function initbody(){
		
}
function save(o1){
	var da = js.getformdata();
	if(!da.name){js.setmsg('名字不能为空');return;}
	if(!da.user){js.setmsg('用户名不能为空');return;}
	js.setmsg('保存中...');
	o1.disabled=true;
	js.ajax({
		type:'post',
		url:'?m=users&a=savecheck',
		data:da,
		success:function(res){
			if(res=='ok'){
				js.back();
			}else{
				js.setmsg(res);
				o1.disabled=false;
			}
		}
	});
}
</script>
</head>

<body>

<?php 
include_once(''.P.'/public/top.html');
?>

<div align="center">

<div style="width:<?=$maxwidth?>;margin:20px 0px" align="left">
	<div style="color:#cccccc">
		<a href="?m=manage" class="zhu"><?=lang('admin.home')?></a> &gt;
		<a href="?m=users" class="zhu"><?=lang('admin.usertitle')?></a> &gt;
		<a href="" class="zhu">人员操作</a>
	</div>
	<div class="mainbody">
		<div style="padding:20px" align="center">
			
			<form name="myform" autocomplete="off">
			<input type="hidden" name="id" value="<?=$da['id']?>">
			<table width="500px">
			<tr>
				<td height="50" align="right">头像&nbsp;&nbsp;</td>
				<td>
				<img src="<?=$da['rs']['faceimg']?>" style="border-radius:50%" id="imgpcid_img" width="80px" height="80px"><br>
				<input style="width:250px" type="hidden" name="face" onblur="if(this.value)get('imgpcid_img').src=this.value" placeholder="请输入头像地址" class="input" id="imgpcid" value="<?=$da['rs']['face']?>">
				<button type="button" class="webbtn webbtn-mini" onclick="js.updateface('头像','imgpcid');">上传</button>
				</td>
			</tr>
			<tr>
				<td height="50" align="right"><font color=red>*</font>名字&nbsp;&nbsp;</td>
				<td><input style="width:250px" name="name" class="input" value="<?=$da['rs']['name']?>"></td>
			</tr>
			<tr>
				<td height="50" align="right"><font color=red>*</font>用户名&nbsp;&nbsp;</td>
				<td><input style="width:250px" name="user" placeholder="用户名不能有中文，用于登录系统" class="input" value="<?=$da['rs']['user']?>"></td>
			</tr>
			
			<tr>
				<td height="50" align="right">所在部门&nbsp;&nbsp;</td>
				<td>
				<input style="width:200px;border-radius:5px 0px 0px 5px;border-right:0" readonly placeholder="" id="headmanabc" name="deptname" class="input" value="<?=$da['rs']['deptname']?>"><button type="button" class="webbtn webbtn-white" onclick="js.changeuser('headmanabc','dept','所在部门');" style="height:36px;border-radius:0px 5px 5px 0px">选择</button>
				<input type="hidden" id="headmanabc_id" value="<?=$da['rs']['deptid']?>" name="deptid">
				</td>
			</tr>
			
			<tr>
				<td height="50" align="right">职位&nbsp;&nbsp;</td>
				<td><input style="width:250px" name="ranking" class="input" value="<?=$da['rs']['ranking']?>"></td>
			</tr>
			
			<tr>
				<td height="50" align="right">邮箱&nbsp;&nbsp;</td>
				<td><input style="width:250px" name="email" class="input" value="<?=$da['rs']['email']?>"></td>
			</tr>
			<tr>
				<td height="50" align="right">手机号&nbsp;&nbsp;</td>
				<td><input style="width:250px" name="mobile" class="input" value="<?=$da['rs']['mobile']?>"></td>
			</tr>
			<tr>
				<td height="50" align="right">类型&nbsp;&nbsp;</td>
				<td><select style="width:250px" name="type" class="input">
				<option value="0">普通用户</option>
				<option value="1" <?php if($da['rs']['type']=='1')echo 'selected';?>>管理员</option>
			</tr>
			<tr>
				<td height="50" align="right">登录密码&nbsp;&nbsp;</td>
				<td><input style="width:250px" name="pass" placeholder="不设置不修改，新增默认123456" class="input" value=""></td>
			</tr>
			<tr>
				<td height="50" align="right"></td>
				<td><button type="button" onClick="save(this)" style="padding:8px 20px;border-radius:5px" class="webbtn" >保存</button>&nbsp;<span id="msgview"><a href="javascript:;" onclick="js.back()">返回</a></span></td>
			</tr>
			</table>
			</form>
			
			
		</div>
	</div>
</div>

<script src="res/js/jquery-changeuser.js"></script>

<?php 
echo $xhrock->filejsbase();
include_once(''.P.'/public/footer.html');
?>
</div>

</body>
</html>